<template>
  <footer>
    <div
      @click="navClick(index)"
      :class="{ iconfont: true, [item.icon]: true, active: ssIndex == index }"
      v-for="(item, index) in navlist"
      :key="index"
    >
      <!-- <p><span class="iconfont"></span></p> -->
      <p>{{ item.name }}</p>
    </div>
  </footer>
</template>

<script>
export default {
  data() {
    return {
      ssIndex: 0,
      navlist: [
        { icon: "icon-home", name: "首页" },
        { icon: "icon-zhuantiguanli", name: "订单" },
        { icon: "icon-yonghu", name: "我的" },
      ],
    };
  },
  methods: {
    navClick(index) {
      return (this.ssIndex = index);
    },
  },
};
</script>

<style scoped>
footer {
  position: fixed;
  bottom: 0;
  background-color: aliceblue;
  border: transparent;
  border-top: 1px solid gray;
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  text-align: center;
}
p{
    font-size: 16px;
}
.iconfont {
  font-size: 30px;
}
.active {
  color: rgb(7, 166, 234);
}
</style>